package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.Benefit;
import com.ssish.saas.eccs.model.BenefitExample;
import com.ssish.saas.eccs.model.BenefitKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface BenefitMapper {
    long countByExample(BenefitExample example);

    int deleteByExample(BenefitExample example);

    @Delete({
        "delete from BENEFIT",
        "where CORP_CODE = #{corpCode,jdbcType=VARCHAR}",
          "and PLAN_CODE = #{planCode,jdbcType=VARCHAR}",
          "and COVERAGE_CODE = #{coverageCode,jdbcType=CHAR}",
          "and BENEFIT_CODE = #{benefitCode,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(BenefitKey key);

    @Insert({
        "insert into BENEFIT (CORP_CODE, PLAN_CODE, ",
        "COVERAGE_CODE, BENEFIT_CODE, ",
        "USER_CODE, LASTEDIT_DATE, ",
        "ACTIVE_FLAG, LOA_DESC, ",
        "ORDSEQ, CASHLESS_HIDE, ",
        "EXCLUDE_PROVIDER, ENGLISH_DESC, ",
        "AMT_INCURRED_DEFAULT, PREAUTH_VALIDITY, ",
        "ISDAYS, WAITING_PERIOD, ",
        "PRINT_REGEXP, CLAIM_APPLICABLE, ",
        "START_DATE, END_DATE, ",
        "REGEXP_FORMAT, CASHLESS_REGEXP_FORMAT, ",
        "ASSESS, AMT_INCURRED_REQCOND, ",
        "PREAUTH_REQUIRED, EDCMAX_VALUE, ",
        "VISIT_RESTRICTED_PROVIDER_ONLY, INSERT_BY, ",
        "INSERT_DATE)",
        "values (#{corpCode,jdbcType=VARCHAR}, #{planCode,jdbcType=VARCHAR}, ",
        "#{coverageCode,jdbcType=CHAR}, #{benefitCode,jdbcType=CHAR}, ",
        "#{userCode,jdbcType=VARCHAR}, #{lasteditDate,jdbcType=TIMESTAMP}, ",
        "#{activeFlag,jdbcType=CHAR}, #{loaDesc,jdbcType=OTHER}, ",
        "#{ordseq,jdbcType=DECIMAL}, #{cashlessHide,jdbcType=CHAR}, ",
        "#{excludeProvider,jdbcType=VARCHAR}, #{englishDesc,jdbcType=VARCHAR}, ",
        "#{amtIncurredDefault,jdbcType=DECIMAL}, #{preauthValidity,jdbcType=DECIMAL}, ",
        "#{isdays,jdbcType=CHAR}, #{waitingPeriod,jdbcType=DECIMAL}, ",
        "#{printRegexp,jdbcType=CHAR}, #{claimApplicable,jdbcType=CHAR}, ",
        "#{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP}, ",
        "#{regexpFormat,jdbcType=VARCHAR}, #{cashlessRegexpFormat,jdbcType=VARCHAR}, ",
        "#{assess,jdbcType=CHAR}, #{amtIncurredReqcond,jdbcType=VARCHAR}, ",
        "#{preauthRequired,jdbcType=CHAR}, #{edcmaxValue,jdbcType=DECIMAL}, ",
        "#{visitRestrictedProviderOnly,jdbcType=CHAR}, #{insertBy,jdbcType=VARCHAR}, ",
        "#{insertDate,jdbcType=TIMESTAMP})"
    })
    int insert(Benefit record);

    int insertSelective(Benefit record);

    List<Benefit> selectByExample(BenefitExample example);

    @Select({
        "select",
        "CORP_CODE, PLAN_CODE, COVERAGE_CODE, BENEFIT_CODE, USER_CODE, LASTEDIT_DATE, ",
        "ACTIVE_FLAG, LOA_DESC, ORDSEQ, CASHLESS_HIDE, EXCLUDE_PROVIDER, ENGLISH_DESC, ",
        "AMT_INCURRED_DEFAULT, PREAUTH_VALIDITY, ISDAYS, WAITING_PERIOD, PRINT_REGEXP, ",
        "CLAIM_APPLICABLE, START_DATE, END_DATE, REGEXP_FORMAT, CASHLESS_REGEXP_FORMAT, ",
        "ASSESS, AMT_INCURRED_REQCOND, PREAUTH_REQUIRED, EDCMAX_VALUE, VISIT_RESTRICTED_PROVIDER_ONLY, ",
        "INSERT_BY, INSERT_DATE",
        "from BENEFIT",
        "where CORP_CODE = #{corpCode,jdbcType=VARCHAR}",
          "and PLAN_CODE = #{planCode,jdbcType=VARCHAR}",
          "and COVERAGE_CODE = #{coverageCode,jdbcType=CHAR}",
          "and BENEFIT_CODE = #{benefitCode,jdbcType=CHAR}"
    })
    @ResultMap("com.ssish.saas.eccs.mapper.BenefitMapper.BaseResultMap")
    Benefit selectByPrimaryKey(BenefitKey key);

    int updateByExampleSelective(@Param("record") Benefit record, @Param("example") BenefitExample example);

    int updateByExample(@Param("record") Benefit record, @Param("example") BenefitExample example);

    int updateByPrimaryKeySelective(Benefit record);

    @Update({
        "update BENEFIT",
        "set USER_CODE = #{userCode,jdbcType=VARCHAR},",
          "LASTEDIT_DATE = #{lasteditDate,jdbcType=TIMESTAMP},",
          "ACTIVE_FLAG = #{activeFlag,jdbcType=CHAR},",
          "LOA_DESC = #{loaDesc,jdbcType=OTHER},",
          "ORDSEQ = #{ordseq,jdbcType=DECIMAL},",
          "CASHLESS_HIDE = #{cashlessHide,jdbcType=CHAR},",
          "EXCLUDE_PROVIDER = #{excludeProvider,jdbcType=VARCHAR},",
          "ENGLISH_DESC = #{englishDesc,jdbcType=VARCHAR},",
          "AMT_INCURRED_DEFAULT = #{amtIncurredDefault,jdbcType=DECIMAL},",
          "PREAUTH_VALIDITY = #{preauthValidity,jdbcType=DECIMAL},",
          "ISDAYS = #{isdays,jdbcType=CHAR},",
          "WAITING_PERIOD = #{waitingPeriod,jdbcType=DECIMAL},",
          "PRINT_REGEXP = #{printRegexp,jdbcType=CHAR},",
          "CLAIM_APPLICABLE = #{claimApplicable,jdbcType=CHAR},",
          "START_DATE = #{startDate,jdbcType=TIMESTAMP},",
          "END_DATE = #{endDate,jdbcType=TIMESTAMP},",
          "REGEXP_FORMAT = #{regexpFormat,jdbcType=VARCHAR},",
          "CASHLESS_REGEXP_FORMAT = #{cashlessRegexpFormat,jdbcType=VARCHAR},",
          "ASSESS = #{assess,jdbcType=CHAR},",
          "AMT_INCURRED_REQCOND = #{amtIncurredReqcond,jdbcType=VARCHAR},",
          "PREAUTH_REQUIRED = #{preauthRequired,jdbcType=CHAR},",
          "EDCMAX_VALUE = #{edcmaxValue,jdbcType=DECIMAL},",
          "VISIT_RESTRICTED_PROVIDER_ONLY = #{visitRestrictedProviderOnly,jdbcType=CHAR},",
          "INSERT_BY = #{insertBy,jdbcType=VARCHAR},",
          "INSERT_DATE = #{insertDate,jdbcType=TIMESTAMP}",
        "where CORP_CODE = #{corpCode,jdbcType=VARCHAR}",
          "and PLAN_CODE = #{planCode,jdbcType=VARCHAR}",
          "and COVERAGE_CODE = #{coverageCode,jdbcType=CHAR}",
          "and BENEFIT_CODE = #{benefitCode,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Benefit record);
}